# 创建一个空字典
my_dict = {}

# 添加键值对
my_dict['apple'] = 1
my_dict['banana'] = 2
my_dict['orange'] = 3

# 获取键对应的值
print(my_dict['apple'])  # 输出1
print(my_dict['banana'])  # 输出2

# 检查键是否存在
print('orange' in my_dict)  # 输出True
print('grape' in my_dict)  # 输出False

# 获取字典的所有键
keys = my_dict.keys()
print(keys)  # 输出['apple', 'banana', 'orange']

# 获取字典的所有值
values = my_dict.values()
print(values)  # 输出[1, 2, 3]

# 删除键值对
del my_dict['banana']
print(my_dict)  # 输出{'apple': 1, 'orange': 3}

# 合并字典
another_dict = {'grape': 5, 'pineapple': 6}
my_dict.update(another_dict)
print(my_dict)  # 输出{'apple': 1, 'orange': 3, 'grape': 5, 'pineapple': 6}
